/** 
 * This library is free software; you can redistribute it and/or modify it under 
 * the terms of the GNU Lesser General Public License as published by the Free 
 * Software Foundation; either version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 
 * details.
 * 
 * You should have received a copy of the GNU Lesser General Public License 
 * along with this library; if not, write to the Free Software Foundation, 
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */
package de.stoneageracer.crafting;

import de.stoneageracer.vehicles.VehiclePart;

/**
 * recipe class to store information about the crafable things
 * @author Philipp
 */
public class Recipe {
    
    /**
     * the VehiclePart to be crafted by using this recipe
     */
    VehiclePart part;
    /**
     * Ingredients Array {wood,stone,bone}
     */
    public int[] ingredient = new int[3];
    
    /**
     * Creates a new Recipe
     * @param part The part that will be crafted
     * @param wood The amount of wood needed
     * @param stone The amount of stone needed
     * @param bone The amount of bones needed
     */
    public Recipe(VehiclePart part, int wood, int stone, int bone){
        this.part = part;
        ingredient[0] = wood;
        ingredient[1] = stone;
        ingredient[2] = bone;
    }
    
    /**
     * Check if the part can be crafted with the given ingedients
     * @param wood The amount of wood
     * @param stone The amount of stone
     * @param bone The amount of bones
     * @return 
     */
    public boolean check(int wood, int stone, int bone){
        if(wood == ingredient[0] && stone == ingredient[1] && bone == ingredient[2]){
            return true;
        }
        return false;
    }
    
}
